package cn.sskxyz.security.client.web.controller;

import org.springframework.security.core.Authentication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.Enumeration;

@RestController
public class AuthController {

    @RequestMapping("/")
    public Authentication auth(HttpServletRequest request, Authentication authentication) {
        Enumeration<String> keys = request.getAttributeNames();
        while (keys.hasMoreElements()) {
            String key = keys.nextElement();
            Object obj = request.getAttribute(key);
            System.out.println(key + "......." + obj.getClass().getName());
        }
        return authentication;
    }
}
